import { ref } from 'vue'

import { apiUrl } from '@/configs/index.ts'
import { generateUUID } from '@/utils/utils.ts'


export default function useCaptcha() {
	const captchaUrl = ref('')

	const refreshCaptcha = () => {
		const uuid = generateUUID()

		captchaUrl.value = `${apiUrl}/common/captcha?id=${uuid}`
	}

	return {
		captchaUrl,
		refreshCaptcha
	}
}